package com.example.demo1122.controller;

import com.example.demo1122.domain.ResponseResult;
import com.example.demo1122.entity.Admin;
import com.example.demo1122.entity.Student;
import com.example.demo1122.entity.Teacher;
import com.example.demo1122.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class LoginController {

    @Autowired
    private ILoginService ILoginService;

    //学生登录
    @PostMapping("/student/login")
    public ResponseResult loginStudent(@RequestBody Student student){
        return ILoginService.loginStudent(student);
    }
    //老师登录
    @PostMapping("/teacher/login")
    public ResponseResult loginTeacher(@RequestBody Teacher teacher){
        return ILoginService.loginTeacher(teacher);
    }
    //管理员登录
    @PostMapping("/admin/login")
    public ResponseResult loginAdmin(@RequestBody Admin admin){
        return ILoginService.loginAdmin(admin);
    }

}


